3.1.25 \(\int \sec (e+f x) (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx\) [25]

3.1.25.1 Optimal result
3.1.25.2 Mathematica [A] (verified)
3.1.25.3 Rubi [A] (verified)
3.1.25.4 Maple [C] (verified)
3.1.25.5 Fricas [A] (verification not implemented)
3.1.25.6 Sympy [F]
3.1.25.7 Maxima [B] (verification not implemented)
3.1.25.8 Giac [A] (verification not implemented)
3.1.25.9 Mupad [B] (verification not implemented)

3.1.25.1 Optimal result

Integrand size = 32, antiderivative size = 94 \[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=\frac {3 a^3 c^2 \text {arctanh}(\sin (e+f x))}{8 f}-\frac {3 a^3 c^2 \sec (e+f x) \tan (e+f x)}{8 f}+\frac {a^3 c^2 \sec (e+f x) \tan ^3(e+f x)}{4 f}+\frac {a^3 c^2 \tan ^5(e+f x)}{5 f} \]

output
3/8*a^3*c^2*arctanh(sin(f*x+e))/f-3/8*a^3*c^2*sec(f*x+e)*tan(f*x+e)/f+1/4* 
a^3*c^2*sec(f*x+e)*tan(f*x+e)^3/f+1/5*a^3*c^2*tan(f*x+e)^5/f
 
3.1.25.2 Mathematica [A] (verified)

Time = 0.49 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.86 \[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=\frac {a^3 c^2 \left (120 \text {arctanh}(\sin (e+f x))+\sec ^5(e+f x) (40 \sin (e+f x)-10 \sin (2 (e+f x))-20 \sin (3 (e+f x))-25 \sin (4 (e+f x))+4 \sin (5 (e+f x)))\right )}{320 f} \]

input
Integrate[Sec[e + f*x]*(a + a*Sec[e + f*x])^3*(c - c*Sec[e + f*x])^2,x]
 
output
(a^3*c^2*(120*ArcTanh[Sin[e + f*x]] + Sec[e + f*x]^5*(40*Sin[e + f*x] - 10 
*Sin[2*(e + f*x)] - 20*Sin[3*(e + f*x)] - 25*Sin[4*(e + f*x)] + 4*Sin[5*(e 
 + f*x)])))/(320*f)
 
3.1.25.3 Rubi [A] (verified)

Time = 0.34 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.86, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.094, Rules used = {3042, 4446, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sec (e+f x) (a \sec (e+f x)+a)^3 (c-c \sec (e+f x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \csc \left (e+f x+\frac {\pi }{2}\right ) \left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right )^3 \left (c-c \csc \left (e+f x+\frac {\pi }{2}\right )\right )^2dx\)

\(\Big \downarrow \) 4446

\(\displaystyle a^2 c^2 \int \left (a \sec ^2(e+f x) \tan ^4(e+f x)+a \sec (e+f x) \tan ^4(e+f x)\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle a^2 c^2 \left (\frac {3 a \text {arctanh}(\sin (e+f x))}{8 f}+\frac {a \tan ^5(e+f x)}{5 f}+\frac {a \tan ^3(e+f x) \sec (e+f x)}{4 f}-\frac {3 a \tan (e+f x) \sec (e+f x)}{8 f}\right )\)

input
Int[Sec[e + f*x]*(a + a*Sec[e + f*x])^3*(c - c*Sec[e + f*x])^2,x]
 
output
a^2*c^2*((3*a*ArcTanh[Sin[e + f*x]])/(8*f) - (3*a*Sec[e + f*x]*Tan[e + f*x 
])/(8*f) + (a*Sec[e + f*x]*Tan[e + f*x]^3)/(4*f) + (a*Tan[e + f*x]^5)/(5*f 
))
 

3.1.25.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4446
Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(c 
sc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.), x_Symbol] :> Simp[((-a)*c)^m 
Int[ExpandTrig[csc[e + f*x]*cot[e + f*x]^(2*m), (c + d*csc[e + f*x])^(n - m 
), x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && EqQ[b*c + a*d, 0] && Eq 
Q[a^2 - b^2, 0] && IntegersQ[m, n] && GeQ[n - m, 0] && GtQ[m*n, 0]
 
3.1.25.4 Maple [C] (verified)

Result contains complex when optimal does not.

Time = 6.60 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.52

method result size
risch \(\frac {i c^{2} a^{3} \left (25 \,{\mathrm e}^{9 i \left (f x +e \right )}+40 \,{\mathrm e}^{8 i \left (f x +e \right )}+10 \,{\mathrm e}^{7 i \left (f x +e \right )}+80 \,{\mathrm e}^{4 i \left (f x +e \right )}-10 \,{\mathrm e}^{3 i \left (f x +e \right )}-25 \,{\mathrm e}^{i \left (f x +e \right )}+8\right )}{20 f \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right )^{5}}-\frac {3 c^{2} a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{8 f}+\frac {3 c^{2} a^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{8 f}\) \(143\)
parts \(\frac {c^{2} a^{3} \tan \left (f x +e \right )}{f}+\frac {c^{2} a^{3} \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )}{f}-\frac {c^{2} a^{3} \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )}{f}-\frac {a^{3} c^{2} \sec \left (f x +e \right ) \tan \left (f x +e \right )}{f}+\frac {2 c^{2} a^{3} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )}{f}\) \(163\)
norman \(\frac {\frac {3 c^{2} a^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}-\frac {7 c^{2} a^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{2 f}-\frac {32 c^{2} a^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{5 f}+\frac {7 c^{2} a^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{7}}{2 f}-\frac {3 c^{2} a^{3} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{9}}{4 f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{5}}-\frac {3 c^{2} a^{3} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{8 f}+\frac {3 c^{2} a^{3} \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{8 f}\) \(173\)
parallelrisch \(-\frac {a^{3} c^{2} \left (\left (\frac {15 \cos \left (f x +e \right )}{2}+\frac {15 \cos \left (3 f x +3 e \right )}{4}+\frac {3 \cos \left (5 f x +5 e \right )}{4}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )+\left (-\frac {15 \cos \left (f x +e \right )}{2}-\frac {15 \cos \left (3 f x +3 e \right )}{4}-\frac {3 \cos \left (5 f x +5 e \right )}{4}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )+\sin \left (2 f x +2 e \right )+2 \sin \left (3 f x +3 e \right )+\frac {5 \sin \left (4 f x +4 e \right )}{2}-\frac {2 \sin \left (5 f x +5 e \right )}{5}-4 \sin \left (f x +e \right )\right )}{2 f \left (\cos \left (5 f x +5 e \right )+5 \cos \left (3 f x +3 e \right )+10 \cos \left (f x +e \right )\right )}\) \(182\)
derivativedivides \(\frac {-c^{2} a^{3} \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )+c^{2} a^{3} \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )+2 c^{2} a^{3} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )-2 c^{2} a^{3} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )+c^{2} a^{3} \tan \left (f x +e \right )+c^{2} a^{3} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}\) \(192\)
default \(\frac {-c^{2} a^{3} \left (-\frac {8}{15}-\frac {\sec \left (f x +e \right )^{4}}{5}-\frac {4 \sec \left (f x +e \right )^{2}}{15}\right ) \tan \left (f x +e \right )+c^{2} a^{3} \left (-\left (-\frac {\sec \left (f x +e \right )^{3}}{4}-\frac {3 \sec \left (f x +e \right )}{8}\right ) \tan \left (f x +e \right )+\frac {3 \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{8}\right )+2 c^{2} a^{3} \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )-2 c^{2} a^{3} \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )+c^{2} a^{3} \tan \left (f x +e \right )+c^{2} a^{3} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}\) \(192\)

input
int(sec(f*x+e)*(a+a*sec(f*x+e))^3*(c-c*sec(f*x+e))^2,x,method=_RETURNVERBO 
SE)
 
output
1/20*I*c^2*a^3*(25*exp(9*I*(f*x+e))+40*exp(8*I*(f*x+e))+10*exp(7*I*(f*x+e) 
)+80*exp(4*I*(f*x+e))-10*exp(3*I*(f*x+e))-25*exp(I*(f*x+e))+8)/f/(1+exp(2* 
I*(f*x+e)))^5-3/8*c^2*a^3/f*ln(exp(I*(f*x+e))-I)+3/8*c^2*a^3/f*ln(exp(I*(f 
*x+e))+I)
 
3.1.25.5 Fricas [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.54 \[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=\frac {15 \, a^{3} c^{2} \cos \left (f x + e\right )^{5} \log \left (\sin \left (f x + e\right ) + 1\right ) - 15 \, a^{3} c^{2} \cos \left (f x + e\right )^{5} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (8 \, a^{3} c^{2} \cos \left (f x + e\right )^{4} - 25 \, a^{3} c^{2} \cos \left (f x + e\right )^{3} - 16 \, a^{3} c^{2} \cos \left (f x + e\right )^{2} + 10 \, a^{3} c^{2} \cos \left (f x + e\right ) + 8 \, a^{3} c^{2}\right )} \sin \left (f x + e\right )}{80 \, f \cos \left (f x + e\right )^{5}} \]

input
integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3*(c-c*sec(f*x+e))^2,x, algorithm="f 
ricas")
 
output
1/80*(15*a^3*c^2*cos(f*x + e)^5*log(sin(f*x + e) + 1) - 15*a^3*c^2*cos(f*x 
 + e)^5*log(-sin(f*x + e) + 1) + 2*(8*a^3*c^2*cos(f*x + e)^4 - 25*a^3*c^2* 
cos(f*x + e)^3 - 16*a^3*c^2*cos(f*x + e)^2 + 10*a^3*c^2*cos(f*x + e) + 8*a 
^3*c^2)*sin(f*x + e))/(f*cos(f*x + e)^5)
 
3.1.25.6 Sympy [F]

\[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=a^{3} c^{2} \left (\int \sec {\left (e + f x \right )}\, dx + \int \sec ^{2}{\left (e + f x \right )}\, dx + \int \left (- 2 \sec ^{3}{\left (e + f x \right )}\right )\, dx + \int \left (- 2 \sec ^{4}{\left (e + f x \right )}\right )\, dx + \int \sec ^{5}{\left (e + f x \right )}\, dx + \int \sec ^{6}{\left (e + f x \right )}\, dx\right ) \]

input
integrate(sec(f*x+e)*(a+a*sec(f*x+e))**3*(c-c*sec(f*x+e))**2,x)
 
output
a**3*c**2*(Integral(sec(e + f*x), x) + Integral(sec(e + f*x)**2, x) + Inte 
gral(-2*sec(e + f*x)**3, x) + Integral(-2*sec(e + f*x)**4, x) + Integral(s 
ec(e + f*x)**5, x) + Integral(sec(e + f*x)**6, x))
 
3.1.25.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 227 vs. \(2 (86) = 172\).

Time = 0.22 (sec) , antiderivative size = 227, normalized size of antiderivative = 2.41 \[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=\frac {16 \, {\left (3 \, \tan \left (f x + e\right )^{5} + 10 \, \tan \left (f x + e\right )^{3} + 15 \, \tan \left (f x + e\right )\right )} a^{3} c^{2} - 160 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{3} c^{2} - 15 \, a^{3} c^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (f x + e\right )^{3} - 5 \, \sin \left (f x + e\right )\right )}}{\sin \left (f x + e\right )^{4} - 2 \, \sin \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\sin \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 120 \, a^{3} c^{2} {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 240 \, a^{3} c^{2} \log \left (\sec \left (f x + e\right ) + \tan \left (f x + e\right )\right ) + 240 \, a^{3} c^{2} \tan \left (f x + e\right )}{240 \, f} \]

input
integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3*(c-c*sec(f*x+e))^2,x, algorithm="m 
axima")
 
output
1/240*(16*(3*tan(f*x + e)^5 + 10*tan(f*x + e)^3 + 15*tan(f*x + e))*a^3*c^2 
 - 160*(tan(f*x + e)^3 + 3*tan(f*x + e))*a^3*c^2 - 15*a^3*c^2*(2*(3*sin(f* 
x + e)^3 - 5*sin(f*x + e))/(sin(f*x + e)^4 - 2*sin(f*x + e)^2 + 1) - 3*log 
(sin(f*x + e) + 1) + 3*log(sin(f*x + e) - 1)) + 120*a^3*c^2*(2*sin(f*x + e 
)/(sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log(sin(f*x + e) - 1)) + 
240*a^3*c^2*log(sec(f*x + e) + tan(f*x + e)) + 240*a^3*c^2*tan(f*x + e))/f
 
3.1.25.8 Giac [A] (verification not implemented)

Time = 0.36 (sec) , antiderivative size = 159, normalized size of antiderivative = 1.69 \[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=\frac {15 \, a^{3} c^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right ) - 15 \, a^{3} c^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right ) - \frac {2 \, {\left (15 \, a^{3} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} - 70 \, a^{3} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 128 \, a^{3} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 70 \, a^{3} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 15 \, a^{3} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )}^{5}}}{40 \, f} \]

input
integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3*(c-c*sec(f*x+e))^2,x, algorithm="g 
iac")
 
output
1/40*(15*a^3*c^2*log(abs(tan(1/2*f*x + 1/2*e) + 1)) - 15*a^3*c^2*log(abs(t 
an(1/2*f*x + 1/2*e) - 1)) - 2*(15*a^3*c^2*tan(1/2*f*x + 1/2*e)^9 - 70*a^3* 
c^2*tan(1/2*f*x + 1/2*e)^7 + 128*a^3*c^2*tan(1/2*f*x + 1/2*e)^5 + 70*a^3*c 
^2*tan(1/2*f*x + 1/2*e)^3 - 15*a^3*c^2*tan(1/2*f*x + 1/2*e))/(tan(1/2*f*x 
+ 1/2*e)^2 - 1)^5)/f
 
3.1.25.9 Mupad [B] (verification not implemented)

Time = 17.53 (sec) , antiderivative size = 188, normalized size of antiderivative = 2.00 \[ \int \sec (e+f x) (a+a \sec (e+f x))^3 (c-c \sec (e+f x))^2 \, dx=\frac {3\,a^3\,c^2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{4\,f}-\frac {\frac {3\,a^3\,c^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^9}{4}-\frac {7\,a^3\,c^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7}{2}+\frac {32\,a^3\,c^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5}{5}+\frac {7\,a^3\,c^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3}{2}-\frac {3\,a^3\,c^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{4}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{10}-5\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6-10\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )} \]

input
int(((a + a/cos(e + f*x))^3*(c - c/cos(e + f*x))^2)/cos(e + f*x),x)
 
output
(3*a^3*c^2*atanh(tan(e/2 + (f*x)/2)))/(4*f) - ((7*a^3*c^2*tan(e/2 + (f*x)/ 
2)^3)/2 + (32*a^3*c^2*tan(e/2 + (f*x)/2)^5)/5 - (7*a^3*c^2*tan(e/2 + (f*x) 
/2)^7)/2 + (3*a^3*c^2*tan(e/2 + (f*x)/2)^9)/4 - (3*a^3*c^2*tan(e/2 + (f*x) 
/2))/4)/(f*(5*tan(e/2 + (f*x)/2)^2 - 10*tan(e/2 + (f*x)/2)^4 + 10*tan(e/2 
+ (f*x)/2)^6 - 5*tan(e/2 + (f*x)/2)^8 + tan(e/2 + (f*x)/2)^10 - 1))